//
//  OptionalViewController.swift
//  test_swift
//
//  Created by fangyuan ding on 2021/6/1.
//

import UIKit

class OptionalChainingViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        func albumReleased(year: Int) -> String? {
            switch year {
            case 2006: return "Taylor Swift"
            case 2008: return "Fearless"
            case 2010: return "Speak Now"
            case 2012: return "Red"
            case 2014: return "1989"
            default: return nil
            }
        }

//        let album = albumReleased(year: 2006)?.uppercased()
//        print("The album is \(album)")
        let str = "Hello world"
        print(str.uppercased())
        
        let album = albumReleased(year: 2006) ?? "unknown"
        print("The album is \(album)")
        //返回确定的值 The album is Taylor Swift
    }
    



}
